#1.导包
from django.conf import settings
from django.core.files.storage import Storage
#2.继承

class FastDFSStorage(Storage):
    def __init__(self, fsdf_base_url=None):

        self.fsdf_base_url = fsdf_base_url or settings.FDFS_BASE_URL
#3.在settings.dev.py 配置一下域名:8888
#4.必须实现 _open _save
    def _open(self, name, mode='rb'):
        pass
    def _save(self, name, content, max_length=None):
        pass
    def url(self, name):
        return self.fsdf_base_url + name
#5.url拼接全路径